package greedy.总结.基础;

import java.util.Arrays;

public class leetcode561数组拆分1 {
    public int arrayPairSum(int[] nums) {
        int length = nums.length;
        Arrays.sort(nums);
        int sum = 0;
        for (int i = 0; i < length; i += 2) {
            sum += nums[i];
        }
        return sum;
    }
}
